package com.powernode.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.powernode.domain.SysLoginUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysLoginUserMapper extends BaseMapper<SysLoginUser> {

    @Select("SELECT DISTINCT t1.perms FROM `sys_menu` as t1 join sys_role_menu as t2 join sys_user_role as t3 on(t1.menu_id=t2.menu_id and t2.role_id=t3.role_id) where t3.user_id = #{value} and t1.type = 2")
    List<String> selectAuthsBySysUserId(Long userId);
}
